package org.monitor.http;

import java.io.Serializable;

public class RestResult implements Serializable {

	private static final long serialVersionUID = 1L;
	
	private int state;
	private String msg;
	private Object data;
	
	public int getState() {
		return state;
	}
	public void setState(int state) {
		this.state = state;
	}
	public String getMsg() {
		return msg;
	}
	public void setMsg(String msg) {
		this.msg = msg;
	}
	public Object getData() {
		return data;
	}
	public void setData(Object data) {
		this.data = data;
	}
	@Override
	public String toString() {
		StringBuffer sb = new StringBuffer("{\"state\":").append(state);
		sb.append(",\"msg\":\"").append(msg == null ? "未知错误！" : msg);
		sb.append("\",\"data\":\"").append(data != null ? data.toString() : "").append("\"}");
		return sb.toString();
	}
	
}
